<template>
  <div class="contact">
    <h1>联系我</h1>
    <div class="contact-content">
      <div class="contact-info">
        <h2>联系方式</h2>
        <div class="contact-item">
          <strong>邮箱：</strong>
          <span>example@email.com</span>
        </div>
        <div class="contact-item">
          <strong>电话：</strong>
          <span>+86 138 0000 0000</span>
        </div>
        <div class="contact-item">
          <strong>地址：</strong>
          <span>北京市朝阳区</span>
        </div>
      </div>
      
      <form class="contact-form" @submit.prevent="handleSubmit">
        <h2>发送消息</h2>
        <div class="form-group">
          <input v-model="form.name" type="text" placeholder="您的姓名" required>
        </div>
        <div class="form-group">
          <input v-model="form.email" type="email" placeholder="您的邮箱" required>
        </div>
        <div class="form-group">
          <textarea v-model="form.message" placeholder="请输入您的消息" rows="5" required></textarea>
        </div>
        <button type="submit">发送消息</button>
      </form>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const form = ref({
  name: '',
  email: '',
  message: ''
})

const handleSubmit = () => {
  alert('消息已发送！我会尽快回复您。')
  form.value = { name: '', email: '', message: '' }
}
</script>

<style scoped>
.contact {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.contact h1 {
  text-align: center;
  margin-bottom: 3rem;
  color: #2c3e50;
  font-size: 2.5rem;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h2,
.contact-form h2 {
  margin-bottom: 2rem;
  color: #2c3e50;
}

.contact-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 5px;
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

button {
  width: 100%;
  padding: 1rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #2980b9;
}

@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact h1 {
    font-size: 2rem;
  }
}
</style>